package com.example.mypplication.coomon

class SimpleSingleTest private constructor(){

    companion object{
        @Volatile private var instance: SimpleSingleTest? = null

        fun getInstance():SimpleSingleTest{
            if(instance==null){
                synchronized(this){
                    if(instance==null){
                        instance = SimpleSingleTest()
                    }
                }
            }
            return instance!!
        }

        fun gerInstanceKotlin():SimpleSingleTest{
            return instance?: synchronized(this){
                instance ?: SimpleSingleTest().apply { instance = this }
            }
        }
    }
}